//
//  HttpRequestFactory.h
//  EZC_Library
//
//  Created by ellzu on 14-9-25.
//  Copyright (c) 2014年 ellzu. All rights reserved.
//

#ifndef __EZC_Library__HttpRequestFactory__
#define __EZC_Library__HttpRequestFactory__

#include <stdio.h>
#include "EZTally/EZTallyObject.h"
#include "EZTallyAutoPtr.h"
#include "HttpRequest.h"
#include "HttpRequestPlatformInterface.h"
#include "EZTally/EZAutoreleasePoolManager.h"
#include "EZAutoreleasePool.h"

namespace EZHttp {
    class HttpRequestFactory : EZTally::EZTallyObject
    {
    public:
        HttpRequestFactory();
    protected:
        ~HttpRequestFactory();
        
    public:
        /**
         **/
        static HttpRequestFactory* defaultFactory();
        
        /**
         return a autorelease httpRequest
        //make default request , if current audoreleasepoll is null , return null 
         **/
        HttpRequest* makeRequest();
        /**
         return a EZTallyTemplateAutoPtr<HttpRequest*>
         **/
        EZTallyTemplateAutoPtr<HttpRequest*> makeRequestAutoPtr();
    protected:
        /**
         使用者必须 release HttpRequest
         **/
        HttpRequest* allocRequest();
    };
}

#endif /* defined(__EZC_Library__HttpRequestFactory__) */
